clear all

** Set working directory: please set your own
/*
cd "~/Dropbox/sanctions_replication/"
*/
** Open dataset
use data/survey_clean.dta, clear

* Run the analyses
* Physical sanctions, sociodemographics (Madrid is ref category for regions)
regr intent_phis_psoe_num female_dummy age_calculated college spanish vote_psoe_ccaa, r
est store psoe_phis_sociodem

* Physical sanctions, attitudes and emotions
regr intent_phis_psoe_num left_right_self pol_interest anger_psoe_num disgust_psoe_num  ///
fear_psoe_num sad_psoe_num, r
est store psoe_phis_attitudes

* Verbal sanctions, sociodemographics (Madrid is ref category for regions)
regr intent_verb_psoe_num female_dummy age_calculated college spanish vote_psoe_ccaa, r
est store psoe_verbal_sociodem

* Verbal sanctions, attitudes and emotions
regr intent_verb_psoe_num left_right_self pol_interest anger_psoe_num disgust_psoe_num  ///
fear_psoe_num sad_psoe_num, r
est store psoe_verbal_attitudes

* Insult, sociodemographics (Madrid is ref category for regions)
regr intent_insult_psoe_num female_dummy age_calculated college spanish vote_psoe_ccaa, r
est store psoe_insult_sociodem

* Insult, attitudes and emotions
regr intent_insult_psoe_num left_right_self pol_interest anger_psoe_num disgust_psoe_num  ///
fear_psoe_num sad_psoe_num, r
est store psoe_insult_attitudes

* PCA direct sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_direct_psoe female_dummy age_calculated college spanish vote_psoe_ccaa, r
est store pca_direct_sociodem_psoe

* PCA direct sanctions, attitudes and emotions
regr pca_direct_psoe left_right_self pol_interest anger_psoe_num disgust_psoe_num  ///
fear_psoe_num sad_psoe_num, r
est store pca_direct_attitudes_psoe

* Deny help, sociodemographics (Madrid is ref category for regions)
regr intent_deny_psoe_num female_dummy age_calculated college spanish vote_psoe_ccaa, r
est store psoe_deny_sociodem

* Deny help, attitudes and emotions
regr intent_deny_psoe_num left_right_self pol_interest anger_psoe_num disgust_psoe_num  ///
fear_psoe_num sad_psoe_num, r
est store psoe_deny_attitudes

* Avoid Interaction, sociodemographics (Madrid is ref category for regions)
regr intent_avoid_psoe_num female_dummy age_calculated college spanish vote_psoe_ccaa, r
est store psoe_avoid_sociodem

* Avoid Interaction, attitudes and emotions
regr intent_avoid_psoe_num left_right_self pol_interest anger_psoe_num disgust_psoe_num  ///
fear_psoe_num sad_psoe_num, r
est store psoe_avoid_attitudes

* Gossip, sociodemographics (Madrid is ref category for regions)
regr intent_gossip_up_num female_dummy age_calculated college spanish vote_psoe_ccaa, r
est store psoe_gossip_sociodem

* Gossip, attitudes and emotions
regr intent_gossip_psoe_num left_right_self pol_interest anger_psoe_num disgust_psoe_num  ///
fear_psoe_num sad_psoe_num, r
est store psoe_gossip_attitudes

* PCA indirect sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_indirect_psoe female_dummy age_calculated college spanish vote_psoe_ccaa, r
est store pca_indirect_sociodem_psoe

* PCA indirect sanctions, attitudes and emotions
regr pca_indirect_psoe left_right_self pol_interest anger_psoe_num disgust_psoe_num  ///
fear_psoe_num sad_psoe_num, r
est store pca_indirect_attitudes_psoe

* PCA all sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_all_psoe female_dummy age_calculated college spanish vote_psoe_ccaa, r
est store pca_all_sociodem_psoe

* PCA all sanctions, attitudes and emotions
regr pca_all_psoe left_right_self pol_interest anger_psoe_num disgust_psoe_num  ///
fear_psoe_num sad_psoe_num, r
est store pca_all_attitudes_psoe

* Make table
esttab psoe_phis_sociodem psoe_phis_attitudes psoe_verbal_sociodem psoe_verbal_attitudes psoe_insult_sociodem psoe_insult_attitudes pca_direct_sociodem_psoe pca_direct_attitudes_psoe psoe_gossip_sociodem psoe_gossip_attitudes ///
psoe_deny_sociodem psoe_deny_attitudes psoe_avoid_sociodem psoe_avoid_attitudes ///
pca_indirect_sociodem_psoe pca_indirect_attitudes_psoe  pca_all_sociodem_psoe pca_all_attitudes_psoe  ///
using tables/tableb11.tex, tex nonumber ///
mtitles("Physical" "Physical" "Verbal" "Verbal" "Insult" "Insult"  "Dir sanct (PCA)" "Dir sanct (PCA)" "Gossip" "Gossip" "Deny help" "Deny help" "Avoid interact" "Avoid interact" "Ind sanct (PCA)" "Ind sanct (PCA)" "All sanctions (PCA)" "All sanctions (PCA)" ) ///
coeflabels(left_right_self "Left-right self placement" ///
female_dummy "Female (dummy)" age_calculated "Age" college "College" spanish "Spanish"  vote_psoe_ccaa "PSOE vote in Region" ///
pol_interest "Political interest"  ///
anger_psoe_num "Anger" disgust_psoe_num "Disgust" fear_psoe_num "Fear" sad_psoe_num "Sadness" _cons "Constant") se ///
replace addnotes("Standard errors are robust")
